<%--
  Created by IntelliJ IDEA.
  User: 86185
  Date: 2024/5/23
  Time: 15:16
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>我的订单</title>
    <meta charset="utf-8">
    <link href="my_likafu/css/myOrder.css" type="text/css" rel="stylesheet">
    <script type="text/javascript" src="my_likafu/js/personal.js"></script>
    <script>
        window.onload = function () {
            document.getElementById("stateId" + "${state+1}").classList.add("active");
        }
    </script>
</head>
<body>
<div>
    <div id="head">
        <img onclick="my_star()" id="head_img1" src="my_likafu/image/fanhui.png">
        <span>我的订单</span>
        <img id="head_img2" src="my_likafu/image/santiaoheigang.png">
    </div>
    <div id="head1">
        <div id="head1_div">
            <span id="head1_span1">订单信息</span><br>
            <span class="span1">累计订单：${num}</span>
            <span class="span1">总消费：￥${money}</span>
        </div>
        <br>
        <div id="head2">
            <div class="state1" id="stateId1" onclick="select(this)">
                <a class="state_a" href="#">待付款</a><br>
                <span>${orderStateNum[0]}</span>
            </div>
            <div class="state1" id="stateId2" onclick="select(this)">
                <a class="state_a" href="#">待发货</a><br>
                <span>${orderStateNum[1]}</span>
            </div>
            <div class="state1" id="stateId3" onclick="select(this)">
                <a class="state_a" href="#">待收货</a><br>
                <span>${orderStateNum[2]}</span>
            </div>
            <div class="state1" id="stateId4" onclick="select(this)">
                <a class="state_a" href="#">待评价</a><br>
                <span>${orderStateNum[3]}</span>
            </div>
            <div class="state1" id="state_end" onclick="select(this)">
                <a class="state_a" href="#">已完成</a><br>
                <span>${orderStateNum[4]}</span>
            </div>
        </div>
    </div>

    <div id="content" style="height: 300px; margin-top: 50px">
        <table>
            <c:forEach items="${shopList}" var="shop" varStatus="state">
                <tr style="width: 300px">
                    <td>${state.index + 1}</td>
                    <td><img style="width: 100px;" src="${shop.goodsImg}"></td>
                    <td>${shop.goodsName}</td>
                    <td>${shop.goodsPrice}</td>

                    <td>
                        <c:if test="${shop.state == 0}">
                            去付款
                        </c:if>
                        <c:if test="${shop.state == 2}">
                            已收货
                        </c:if>
                        <c:if test="${shop.state == 3}">
                            去评价
                        </c:if>
                    </td>
                </tr>
            </c:forEach>
        </table>
    </div>
</div>
</body>
</html>
